package constant;

import okhttp3.MediaType;

import java.nio.charset.Charset;

public class MediaTypeConstants {

    public static final MediaType MEDIA_TYPE_FORM = MediaType.parse(ContentType.FORM_URLENCODED.getValue());
    public static final MediaType MEDIA_TYPE_JSON = MediaType.parse(ContentType.JSON.getValue());
    public static final MediaType MEDIA_TYPE_MULTIPART = MediaType.parse(ContentType.MULTIPART.getValue());
    private enum ContentType{
        FORM_URLENCODED("application/x-www-form-urlencoded"),
        MULTIPART("multipart/form-data"),
        JSON("application/json"),
        XML("application/xml"),
        TEXT_PLAIN("text/plain"),
        TEXT_XML("text/xml"),
        TEXT_HTML("text/html"),
        OCTET_STREAM("application/octet-stream");

        private final String value;

        private ContentType(String value) {
            this.value = value;
        }

        public String getValue() {
            return this.value;
        }

        public String toString() {
            return this.getValue();
        }


    }
}
